package com.tsystems.school;

/**
 * Created by IntelliJ IDEA.
 * User: victorn
 * Date: 8/14/11
 * Time: 12:53 AM
 * To change this template use File | Settings | File Templates.
 */
public class Entity<K, V> {

    private final int hash;

    private MyLinkedList<K, V> list;

    public Entity(int hash) {
        list = new MyLinkedList();
        this.hash = hash;
    }

    public V add(K key, V val) {
        return list.put(key, val);
    }

    public boolean containsKey(K key) {
        return list.containsKey(key);
    }

    public boolean containsValue(V val) {
        return list.containsValue(val);
    }

    public boolean contains(K key, V val) {
        return list.contains(key, val);
    }

    public V remove(K key) {
        return list.remove(key);
    }

    public int size() {
        return list.size();
    }

    public int getHash() {
        return hash;
    }

   /* public void setHash(int hash) {
        this.hash = hash;
    }        */

    public V get(K key){
        return list.get(key);
    }

    public ListItem<K,V>[] getAll(){
        return list.asArray();
    }

}
